package org.spolo.android.util;

import org.spolo.android.bean.ActionParameter;
import org.spolo.android.enventmanager.EventHandlerInterface;
import org.spolo.android.nodetree.Vcanvas;

public class McStop implements EventHandlerInterface {

	private boolean bf = false;

	@Override
	public Object execute(Object parameter) {
		ActionParameter ap = (ActionParameter) parameter;
		Vcanvas vc =  ap.getVcanvas();
		if(vc == null || !(vc instanceof MovieClip)){
			System.out.println("没有获取到是哪个movieclip触发的该事件");
			return null;
		}
		MovieClip mc = (MovieClip) vc;
		if (!bf) {
			mc.stop();
			bf = true;
		} else {
			mc.start();
			bf = false;
		}

		return null;
	}

}
